package com.demo.resourcecode.annotationutil.aliasFor2;

import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.annotation.AnnotationUtils;
import com.demo.resourcecode.annotationutil.aliasFor1.MyAnnotation;

@SubMyAnnotation(subLocation = "location11")
public class AnnotationUtilsDemo {

    public static void main(String[] args) {
    	//SubMyAnnotation myAnnotation = AnnotationUtils.getAnnotation(AnnotationUtilsDemo.class, SubMyAnnotation.class);
        //System.out.println("value:" + myAnnotation.value() + "; loation:" + myAnnotation.subLocation());

        //Scope scopeAnnocation = AnnotationUtils.findAnnotation(AnnotationUtilsDemo.class, Scope.class);
        //System.out.println("@Scope : " + scopeAnnocation);
        //System.out.println("@Scope value: " + AnnotationUtils.getValue(scopeAnnocation, "scopeName"));

        MyAnnotation myAnnotation2 = AnnotatedElementUtils.findMergedAnnotation(AnnotationUtilsDemo.class, MyAnnotation.class);
        System.out.println("@MyAnnotation location: " + AnnotationUtils.getValue(myAnnotation2, "location"));
    }

}